
import { v4 as uuidv4} from "uuid"

export default ()=>{
  //先获取本地存储的UUIDTOKEN
  let uuid_token = localStorage.getItem('UUIDTOKEN')
  //如果本地存储没有UUIDTOKEN
  if(!uuid_token){
    //则生成一个UUIDTOKEN，并将它存入本地存储
      uuid_token = uuidv4()
      localStorage.setItem('UUIDTOKEN',uuid_token)
  }
  //返回给仓库
  return uuid_token;
}